//
//  ZhuShouViewController.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/3/2.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "ZhuShouViewController.h"

#import "ChouViewController.h"
#import "GouViewController.h"
#import "QianViewController.h"

@interface ZhuShouViewController ()

@end

@implementation ZhuShouViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    self.view.backgroundColor = BgColor;
    
    NSArray *arr = [NSArray arrayWithObjects:@"    我的认筹",@"    我的认购",@"    我的签约", nil];
    NSArray *imgArr = [NSArray arrayWithObjects:@"renchou",@"rengou",@"qianyue", nil];
    for (int i = 0; i<arr.count; i++)
    {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.backgroundColor = [UIColor whiteColor];
        btn.frame = CGRectMake(0, 2+i*51, B_WIDTH, 50);
        [btn setTitle:arr[i] forState:0];
        btn.tag = 15+i;
        [btn setImage:[UIImage imageNamed:imgArr[i]] forState:0];
        //[btn layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:30];
        btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;//左对齐
        [btn setImageEdgeInsets:UIEdgeInsetsMake(5, 10, 5, 100)];

        [btn setTitleColor:[UIColor colorWithHexString:@"#ff8300"] forState:0];
        btn.titleLabel.font = [UIFont systemFontOfSize:18];
        [btn addTarget:self action:@selector(zhuShouBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:btn];
        
    }
    
}

-(void)zhuShouBtnClick:(UIButton *)btn
{
    if (btn.tag ==15)
    {
        ChouViewController *chouVC = [[ChouViewController alloc] init];
        [self.navigationController pushViewController:chouVC animated:NO];
    }
    if (btn.tag == 16)
    {
        GouViewController *gouVC = [[GouViewController alloc] init];
        [self.navigationController pushViewController:gouVC animated:NO];
    }
    if (btn.tag == 17)
    {
        QianViewController *qianVC = [[QianViewController alloc] init];
        [self.navigationController pushViewController:qianVC animated:NO];
    }
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
